<!Doctype html>
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<title>演示文档</title>
</head>

<?php 

/* *
 * 功能：/order/create
 * 版本：1.0
 * 日期：2015/5/15
 * 说明：
 * 以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写，并非一定要使用该代码。
 * 该代码仅供学习和研究提供一个参考。
 */


//引入模型文件
include_once("lib/yhd.php");

//创建对象
$orderCreate = new orderCreate();

//联系人信息  //需与订单验证信息保持一致
$orderCreate->receiver_id = "10000";
$orderCreate->receiver_name = "张三";
$orderCreate->receiver_province = "上海";
$orderCreate->receiver_city = "上海市";
$orderCreate->receiver_county = "浦东新区";
$orderCreate->receiver_address = "张江高科祖冲之路295号";
$orderCreate->receiver_mobile = "18087895621";
$orderCreate->receiver_phone = "010-51680666";

//商品信息 每个商品信息作为一个数组，多个商品设置循环 执行第39行 - 第50行代码即可

/*--------------------------------------多个商品循环执行 start-----------------------------------*/
$goods = array(
		"itemId"=>"item11",
		"skuId"=>"",
		"outerCode"=>"",
		"yhdProductId"=>"1799723",
		"yhdProductCode"=>"0017997238",
		"num"=>"2",
		"price"=>"18.8",
		"totalFee"=>"37.6",
		"discountFee"=>0
		);
$orderCreate->tradeItemList[] = $goods;
/*--------------------------------------多个商品循环执行 end-----------------------------------*/

//其它参数
$orderCreate->thirdOrderCode = "daogouTEST0013";
$orderCreate->paymentAmount = 37.6;
$orderCreate->orderDiscount = 0.00;
$orderCreate->productAmount = 37.6;
$orderCreate->invoiceName = "zhangsan";
$orderCreate->invoiceContent = "纽海信息技术(上海)有限公司";
$orderCreate->splitTicket = "ticket=b9b3dc2d-c288-4855-963a-116b5660a069,splitFactors=";//根据验证接口返回
$orderCreate->splitSign = "f2707686b3e5b5c341199cf7612f0d8c";                           //根据验证接口返回
$orderCreate->splitTime = "1432269500928";                                              //根据验证接口返回
$orderCreate->fourthAreaId = "128814";                                                  //根据验证接口返回
$orderCreate->postFee = 0;                                                              //根据验证接口返回

//执行查询
$ret = $orderCreate->execute();


//该代码可查看接口全部返回结果
print_r($ret);



//返回结果数据使用示例
echo $ret->returnCode;
echo "<br>";
echo $ret->trackId;
echo "<br>";
$yhdOrderCode = $ret->responseBizData->yhdOrderCode;
$orderCreateTime = $ret->responseBizData->orderCreateTime;



?>